# Contributor: Shiz <hi@shiz.me>
# Maintainer: Shiz <hi@shiz.me>
pkgname=icmake
pkgver=9.03.01
pkgrel=0
pkgdesc="Make utility using a C-like grammar"
url="https://fbb-git.gitlab.io/icmake/"
arch="all"
license="GPL-3.0-or-later"
makedepends="bash"
subpackages="$pkgname-doc"
source="https://gitlab.com/fbb-git/icmake/-/archive/$pkgver/icmake-$pkgver.tar.bz2"
patch_args="-p2"
builddir="$srcdir/icmake-$pkgver/icmake"

prepare() {
	default_prepare

	sed -i '/^#define DOCDOCDIR/d' INSTALL.im
	echo '#define DOCDOCDIR "usr/share/doc/icmake"' >> INSTALL.im
}

build() {
	export CFLAGS="$CFLAGS -O2"
	./icm_prepare /
	./icm_bootstrap x
}

package() {
	./icm_install strip all "$pkgdir"
}

sha512sums="
f3c76c19bf26926306ddce9491ae432a92f097bef2cc6434cb44e849a518c3e63beebdfc8edeb3ad26586ef13a7ed7a6e6074af710eb8a6573dac1f768db8c95  icmake-9.03.01.tar.bz2
"
